package com.hd.controller;

import com.hd.pojo.InstrInfo;
import com.hd.pojo.Member;
import com.hd.pojo.User;
import com.hd.service.InstrInfoService;
import com.hd.service.MemberService;
import com.hd.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by 1 on 2017/10/27.
 */
@Controller
@RequestMapping("/director/reservationInstroe")
public class ReservationController {

    @Resource
    private MemberService memberService;

    @Resource
    private InstrInfoService instrInfoService;

    @Resource
    private UserService userService;


    @RequestMapping("/RI")
    public String RI(Integer caseNo, Integer memberId,Integer caseId, Model model){
        model.addAttribute("caseNo",caseNo);
        System.out.println(caseId);
        model.addAttribute("caseId",caseId);
        model.addAttribute("memberId",memberId);
        Member member = memberService.searchMember(memberId);
        model.addAttribute("member",member);
        List<InstrInfo> instrInfoList = instrInfoService.searchAllInstrInfo();
        model.addAttribute("instrInfoList",instrInfoList);
        List<User> userList = userService.searchDirector();
        model.addAttribute("userList",userList);
        return "director/reservationInstroe";
    }

}
